pidkill=$1
pidlist=` ps -eo ppid,pid | sed 1d | awk '{ if( $1!= $2 ) print $1"\t"$2 }' | sort | uniq `

set -u

killpid()
{
	set -x
    kill -9 "$1"
	set +x
    
    for subpid in ` echo "$pidlist" | awk -F"\t" '{ if( $1=='"$1"' ) print $2 }' `
    do
        killpid "$subpid" 
    done

}

killpid "$pidkill"
